import 'package:bubble/bubble.dart';
import 'package:flutter/material.dart';

/// 头像 + 聊天气泡
class HeadBubble extends StatelessWidget {

  final BubbleStyle style;

  final String content;

  final String someBody;

  final String me;

  HeadBubble({this.style, this.content, this.someBody, this.me});

  @override
  Widget build(BuildContext context) {
    if (style.nip == BubbleNip.leftTop) {
      return Container(
        child: ListTile(
          leading: new Image.asset('asserts/$someBody.png',width: 35,height: 35,fit: BoxFit.cover,),
          title: Bubble(
            style: style,
            child: Text(content),
          ),
        ),
      );
    }  else {
      return Container(
        child: ListTile(
          trailing: new Image.asset('asserts/$me.png',width: 35,height: 35,fit: BoxFit.cover,),
          title: Bubble(
            style: style,
            child: Text(content),
          ),
        ),
      );
    }

  }
}